#pragma once

#include <iostream>
#include <memory>

class Request
{
    int _data_x, _data_y;
    char _oper;

public:
    Request() {}
    Request(int x, int y, char op) : _data_x(x), _data_y(y), _oper(op)
    {
    }

    ~Request() {}

    void Debug()
    {
        std::cout << "_data_x:" << _data_x << "  _data_y:" << _data_y << "  _oper:" << _oper << std::endl;
    }

    void Inc()
    {
        _data_x++;
        _data_y++;
    }
};

class Response
{
    int _result, _code; //_code 状态码
public:
    Response() {}
    Response(int result, int code) : _result(result), _code(code)
    {
    }

    ~Response() {}
};



// 工厂模式
class Factory
{
public:
    std::shared_ptr<Request> BuildRequest()
    {
        return std::make_shared<Request>();
    }
    std::shared_ptr<Request> BuildRequest(int x, int y, char op)
    {
        return std::make_shared<Request>(x, y, op);
    }

    std::shared_ptr<Response> BuildResponse()
    {
        return std::make_shared<Response>();
    }

    std::shared_ptr<Response> BuildResponse(int result, int code)
    {
        return std::make_shared<Response>(result, code);
    }
};